
class DSLBuilder
  def self.load( dsl)
    proj=new
    proj.instance_eval(File.read(dsl), dsl)
    proj
  end
end 
  
  
class QuoteDSLBuilder <DSLBuilder

  def create_quote(lob, cntry)
    puts "start create quote:"+lob+"---"+cntry
    yield
  end



  def select_customer(custNum)  # '0000000001'
 
    puts "create cutstomer #{custNum}"
 
  end

  def add_parts(*partNum) # 'E0033F5','DFG0051'
    partNum.each do |p|
      puts "add parts #{p}"
    end

  end
  def change_quantity(partNum, quantity)  # 'E0033F5', 10
  
    puts "change quantity"

  end

  def recalculate_quote
    puts "recalculate quote"
  end
end#class QuoteDSLBuilder

dsl_file =  ARGV.shift

dsl_file='create_quote.dsl' if dsl_file == nil

QuoteDSLBuilder.load(dsl_file)

